package com.wkbb.basic.thread;

import com.wkbb.basic.service.UserOpenService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author dengjingyuan
 * @date 2020-01-07 09:57
 */
@Slf4j
public class ImRepairImClassGroupInfoTask implements Runnable {

    private Long userId;

    private Long orgId;

    private UserOpenService userOpenService;

    public ImRepairImClassGroupInfoTask(Long userId,Long orgId,UserOpenService userOpenService) {
        this.userId = userId;
        this.orgId = orgId;
        this.userOpenService = userOpenService;
    }

    public ImRepairImClassGroupInfoTask() {

    }

    @Override
    public void run() {
        log.info("*********ImRepairImClassGroupInfoTask********userId:{},orgId:{},userOpenService:{}", userId,orgId,userOpenService);
        try {

            log.info("----------准备自动修复IM用户(包含群信息)--------userId-{},orgId:{},userOpenService-{}",userId,orgId,userOpenService);
            Thread.sleep(400);
            userOpenService.repairImClassGroupInfo(userId,orgId);
        } catch (Exception e) {
            log.error("*******ImRepairImClassGroupInfoTask**********", e);
        }
    }
}
